<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div>

    </div>
    <script>
        const div=  document.querySelector('div');
        const getDate = ()=>{
            const date = new Date();
            let h = date.getHours();
            let m = date.getMinutes();
            let s = date.getSeconds();
            h = h < 10 ? '0' + h : h;
            m = m < 10 ? '0' + m : m;
            s = s < 10 ? '0' + s : s;
            return `${date.getFullYear()} 年 ${date.getMonth()+1} 月 ${date.getDate()} 日 ${h} : ${m} : ${s}`;  
        }
        div.innerHTML = getDate();

        setInterval(()=>{
            div.innerHTML = getDate();
        },1000)

    </script>
</body>
</html>